<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no" />
    <link rel="stylesheet" type="text/css" href="../css/toupiaoliebiao.css" />
    <title>投票列表</title>
</head>
<body>
    <div class="new voteList">
        <div class="content" id="voteList">
            <!-- <div class="con">
                <div class="item-vote">
                    <div class="act-photo"></div>
                    <div class="act-message">
                        <div class="act-title">
                            <div class="name">航空旅程5折抢兑</div>
                            <span class="time">2017年8月1日</span>
                        </div>
                        <div class="act-mess">
                            本活动仅限收到我行邀请短信的主卡持卡人参加活动，活动期间不能随意更换卡种，不能使用不能使用不能使用不能使用不能使用      
                        </div>
                    </div>
                </div>
                <div class="vote-box">
                    <div class="vote-item left">31245参与投票</div>
                    <div class="vote-item center">784人围观</div>
                    <div class="vote-item right">人气王张三</div>
                </div>
            </div>
            <div class="con">
                <div class="item-vote">
                    <div class="act-photo"></div>
                    <div class="act-message">
                        <div class="act-title">
                            <div class="name">航空旅程5折抢兑</div>
                            <span class="time">2017年8月1日</span>
                        </div>
                        <div class="act-mess">
                            本活动仅限收到我行邀请短信的主卡持卡人参加活动，活动期间不能随意更换卡种，不能使用不能使用不能使用不能使用不能使用      
                        </div>
                    </div>
                </div>
                <div class="vote-box">
                    <div class="vote-item left">31245参与投票</div>
                    <div class="vote-item center">784人围观</div>
                    <div class="vote-item right">人气王张三</div>
                </div>
            </div> -->
        </div> 
    </div>
    <!-- 投票列表模板 begin -->
        <script type="text/html" id="voteList-template">
            {{each}}
                <div class="con" onclick="fnVoteDetail({{$value.id}})">
                    <div class="item-vote">
                        {{if $value.picture}}
                            <div class="act-photo" style="background-image: url({{$value.picture}});"></div>
                        {{/if}}
                        <div class="act-message">
                            <div class="act-title">
                                <div class="name">
                                    <p class="blod">{{$value.title}}</p>
                                    <!-- <span class="underway {{if $value.is_active == 2}}active{{/if}}">{{{'1':'未开始','2':'进行中','3':'已结束'}[$value.is_active]}}</span> -->
                                </div>
                                <span class="time">{{$value.time_start.split(' ')[0]}}</span>
                            </div>
                            <div class="act-mess">
                                {{#$value.brief}}
                            </div>
                        </div>
                    </div>
                    <div class="vote-box">
                        <div class="vote-item left">{{$value.quantity}}参与投票</div>
                        <div class="vote-item center">{{$value.browse}}人围观</div>
                        <div class="vote-item right">人气王{{$value.popular}}</div>
                    </div>
                </div>
            {{/each}}
        </script>
        <!-- 投票列表模板 end --> 
        <div class="hide" id="no-data">暂无数据</div>
</body>
<script type="text/javascript" src="../framework/template-web.js"></script>
<script type="text/javascript" src="../script/jquery-2.0.3.min.js"></script>
<script type="text/javascript" src="../script/base.js"></script>
<script type="text/javascript">
    fnList();
    //列表
    function fnList(){
        //活动
        fnAjax({
            url: "Vote/voteList",
            data: {
			
            }
        }, function(ret){
            console.log(ret);
            if( !ret.status ){
                if(ret.data.list){
                    $('.voteList').removeClass('hide');
                    fnValue('#voteList',template('voteList-template',ret.data.list));
                }else{
					$('#no-data').removeClass('hide');
				}
            }else{
                
            }
        });
    }
    
    //跳转投票详情
    function fnVoteDetail( _id ){
        fnOpen("toupiaoxiangqing.html",{
            id:_id
        });
    }
</script>
</html>
